using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace Umdf.SideShow.Contents
{
    public class UnknownContent : Content
    {
        private byte[] _data;

        public UnknownContent()
        {
        }

        public UnknownContent(BinaryReader reader)
        {
            DeserializeObject(reader);
        }

        public UnknownContent(uint id, byte[] data) : base(id)
        {
            _data = data;
        }

        public byte[] Data
        {
            get { return _data; }
        }

        

        protected internal override void DeserializeObject(BinaryReader reader)
        {
            base.DeserializeObject(reader);
            int l = reader.ReadInt32();
            _data = reader.ReadBytes(l);
        }

        protected internal override void SerializeObject(BinaryWriter writer)
        {
            base.SerializeObject(writer);
            writer.Write(_data.Length);
            writer.Write(_data);
        }
    }
}
